import request from '@/utils/request'

const BASE = '/api/client/v1/task'

const TASK_API = {
  getToday: () =>
    request<any, TaskItemVO[]>({ url: `${BASE}/today`, method: 'get' }),

  getGateTodayStatus: () =>
    request<any, { hasPending: boolean }>({
      url: `${BASE}/gate/today/status`,
      method: 'get',
    }),

  refreshItem: (id: number) =>
    request({ url: `${BASE}/item/${id}/refresh`, method: 'post' }),
}

export default TASK_API

export interface TaskItemVO {
  id: number
  seriesId: number
  programId: number
  unitId: number
  passScore: number
  status: number
  score: number
  canTest: boolean
}

